package win.zxshuo.www.TextUtils;

import java.util.ArrayList;
import java.util.List;

public class Chapter {

    private String title;

    private List<String> paragraphs;

    private Integer wordNum;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public List<String> getParagraphs() {
        return paragraphs;
    }

    public void setParagraphs(List<String> paragraphs) {
        this.paragraphs = paragraphs;
    }

    public void addParagraph(String paragraph){
        if (this.paragraphs == null){
            this.paragraphs = new ArrayList<>();
        }
        this.paragraphs.add(paragraph);
    }

    public String getStringP(){
        String p ="";
        for (String line:paragraphs){
            p += "<p>"+line.replace("　","").replace(" ","")+"</p>";
        }
        return p;
    }

}
